<?php
include("../csdl.php");
$knoi=new csdl();
if(isset($_GET['makh']))
	$where=" and makh!='".$_GET['makh']."'";
else
	$where='';
if(isset($_GET['mail']))
{
	if($_GET['mail']=='')
	{
		echo "";
		echo "<input type='hidden' name='kt_mail' value='0' />";
	}
	else
	{
		$mail=$_GET['mail'];
		$where="mail='".$mail."'".$where;
		$query=$knoi->queryCsdl("select makh from khachhang where ".$where);
		if(mysql_num_rows($query)==0)
		{	
			echo " &nbsp;<img src='images/Check-icon.png' border='0' title='Email hợp lệ!' />";
			echo "<input type='hidden' name='kt_mail' value='0' />";
		}
		else
		{	
			echo " &nbsp;<img src='images/Sign-Error-icon1.png' border='0' title='Email đã tồn tại!' />";
			echo "<input type='hidden' name='kt_mail' value='1' />";
		}
	}
}
if(isset($_GET['tendn']))
{
	$tendn=$_GET['tendn'];
	if($tendn=='')
	{
		echo "";
		echo "<input type='hidden' name='kt_tendn' value='0' />";
	}
	else
	{
		$where="tendn='".$tendn."'".$where;
		$query=$knoi->queryCsdl("select makh from taikhoan where ".$where);
		if(mysql_num_rows($query)==0)
		{	echo " &nbsp;<img src='images/Check-icon.png' border='0' title='Tên đăng nhập hợp lệ!' />";
			echo "<input type='hidden' name='kt_tendn' value='0' />";
		}
		else
		{	
			echo " &nbsp;<img src='images/Sign-Error-icon1.png' border='0' title='Tên đăng nhập đã tồn tại!' />";
			echo "<input type='hidden' name='kt_tendn' value='1' />";
		}
	}
}
?>
